/*
*	File: CoreBone.cpp
*	Date: 12/06/2011
*	Author: Ivan Gao
*	Desc:
*/
#include "CoreBone.h"

SCoreBone::SCoreBone (const char * pBoneName) : m_strBoneName (pBoneName), m_nParentId (-1), m_pCoreSkeleton (NULL)
{
	m_vecChildId.clear ();
}

SCoreBone::~SCoreBone ()
{

}

bool SCoreBone::AddChildId(int nChildId)
{
	m_vecChildId.push_back(nChildId);
	return true;
} // AddChildId

// void SCoreBone::RecursiveCalculateState ()
// {
// 	if (m_nParentId == -1)
// 	{
// 		m_translationAbsolute = 
// 	}
// } // RecursiveCalculateState

vector<int> & SCoreBone::GetChildVectorId ()
{
	return m_vecChildId;
} // GetChildVectorId

const string & SCoreBone::GetBoneName () const
{
	return m_strBoneName;
} // GetBoneName

void SCoreBone::SetBoneName (const string & strBoneName)
{
	m_strBoneName = strBoneName;
} // SetBoneName

const vector<int> & SCoreBone::GetChildVectorId() const
{
	return m_vecChildId;
} // GetChildVectorId

void SCoreBone::SetCoreSkeleton (SCoreSkeleton * pCoreSkeleton)
{
	m_pCoreSkeleton = pCoreSkeleton;
} // SetCoreSkeleton

const SCoreSkeleton * SCoreBone::GetCoreSkeleton () const
{
	return m_pCoreSkeleton;
} // GetCoreSkeleton

SCoreSkeleton * SCoreBone::GetCoreSkeleton ()
{
	return m_pCoreSkeleton;
} // GetCoreSkeleton

void SCoreBone::SetRotation(const SQuaternion & rQua)
{
	memcpy (m_rotation.v, rQua.v, sizeof (m_rotation.v));
} // SetRotation

void SCoreBone::SetRotationBoneSpace (const SQuaternion & rQua)
{
	memcpy (m_rotationBoneSpace.v, rQua.v, sizeof (m_rotationBoneSpace.v));
} // SetRotationBoneSpace

void SCoreBone::SetTranslation (const SVector3 & rTrans)
{
	m_translation = rTrans;
} // SetTranslation

void SCoreBone::SetTranslationBoneSpace (const SVector3 & rTrans)
{
	m_translationBoneSpace = rTrans;
} // SetTranslationBoneSpace

const SQuaternion & SCoreBone::GetRotation () const
{
	return m_rotation;
} // GetRotation

const SQuaternion & SCoreBone::GetRotationAbsolute() const 
{
	return m_rotationAbsolute;
} // GetRotationAbsolute

const SQuaternion & SCoreBone::GetRotationBoneSpace() const 
{
	return m_rotationBoneSpace;
} // GetRotatonBoneSpace

const SVector3 & SCoreBone::GetTranslation () const 
{
	return m_translation;
} // GetTranslation

const SVector3 & SCoreBone::GetTranslationAbsolute () const
{
	return m_translationAbsolute;
} // GetTranslationAbsolute

const SVector3 & SCoreBone::GetTranslationBoneSpace () const
{
	return m_translationBoneSpace;
} // GetTranslationBoneSpace

void SCoreBone::SetParentId (int nChildId)
{
	m_nParentId = nChildId;
} // SetParentId

int SCoreBone::GetParentId (void) const
{
	return m_nParentId;
} // GetParentId


void SCoreBone::Scale (float scale)
{

} // Scale

void SCoreBone::RecursiveCalculateState()
{

} // RecursiveCalculateState



